import axios from 'axios'
const request = axios.create({
  baseURL: '/mock',
  timeout: 20000
})
request.interceptors.request.use(config => {
  return config
})
request.interceptors.response.use(
  response => {
    return response.data
  },
  error => {
    alert('请求出错: ' + error.message || '未知错误')
    return Promise.reject(error)
  }
)
export default request
